﻿using FinPlusComponents;
using QLNet;

namespace FinPlusAnalytics
{
    public class CdsSpread : FinPlusComponent
    {
        public string Name { get; private set; }
        public RelinkableHandle<Quote> Rate { get; private set; }
        public RateHelper RateHelper { get; private set; }

        public CdsSpread(string marketName, string name, string spread, string recoveryRate, string tenor, string fixingDays, string dicountCurveName, string freq, string dayCount, string bizConv, string holidays, bool endOfMonth = true)
        {
            Name = name;
            var market = Markets.Instance.GetMarket(marketName);

            //TODO QLNet has no cds deafult etc
            //if(!discountCurve) return "#cant find discount curve";
		    //boost::shared_ptr<DefaultProbabilityHelper> cds(new SpreadCdsHelper(setQuote(marketName, instName, spread), getPeriod(tenor), fixingDays, Holidays(holidays), Freq(freq), BizConv(bizConv), DateGeneration::TwentiethIMM, DayCount(dayCount), recoveryRate, Handle<QuantLib::YieldTermStructure>(discountCurve)));	
		    //defaultHelpers[marketName][instName] = cds;
        }
    }
}
